import * as types from '../mutation-type'

const state = {
  background: '',
  search: ''
}

const getters = {
  getBackground: state => state.background,
  getSearch: state => state.search
}

const mutations = {
  [types.SET_BACKGROUND] (state, background) {
    state.background = background
  },
  [types.SET_SEARCH] (state, search) {
    state.search = search
  }
}

const actions = {
  setBackground ({commit, state}, background) {
    commit(types.SET_BACKGROUND, background)
  },
  setSearch ({commit, state}, search) {
    commit(types.SET_SEARCH, search)
  }
}

export default {
  state,
  getters,
  mutations,
  actions
}
